package flyweight;

public class MainTest9 {
    public static void main(String[] args) {
        String subject = "数学";
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 30; j++) {
                SignInfo signInfo = new SignInfo();
                signInfo.setId(i);
                String location = "上海" + j;
                signInfo.setSubject(subject);
                signInfo.setLocation(location);
                SignInfoFactory.getSignInfo(subject + location);
            }
        }
        String key = subject+ "上海5";
        SignInfo signInfo1 = SignInfoFactory.getSignInfo(key);
        SignInfo signInfo2 = SignInfoFactory.getSignInfo(key);
        System.out.println(signInfo1 == signInfo2);
    }
}
